package com.glSto.controller;

import com.glSto.domain.ResultResponse;
import com.glSto.rep.WorkOrderResponseDTO;
import com.glSto.req.WorkOrderRequestDTO;
import com.glSto.service.WorkOrderService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/Power.GULEISTO/GULEISTO")
public class WorkOrderController {

    @Resource
    private WorkOrderService workOrderService;

    private static final Logger workOrderLogger = LoggerFactory.getLogger("com.glSto.controller.WorkOrderController.workOrder");
    private static final Logger workOrderRepLogger = LoggerFactory.getLogger("com.glSto.controller.WorkOrderController.workOrderRep");

    /**
     * 工单创建接口
     */
    @PostMapping("/createWorkOrder")
    public ResultResponse createWorkOrder() {
        return workOrderService.createWorkOrder();
    }

    @PostMapping("/getWorkOrderRep")
    public void getWorkOrder(@RequestBody String requestBody) {
        workOrderRepLogger.info("接收工单创建反馈数据：" + requestBody);
    }
}